inherited fmPodotchCommon: TfmPodotchCommon
  Left = 492
  Top = 156
  Width = 1058
  Height = 804
  Caption = #1055#1086#1076#1086#1090#1095#1077#1090
  Constraints.MinHeight = 804
  Constraints.MinWidth = 1000
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  inherited sbBottom: TStatusBar
    Top = 739
    Width = 1042
  end
  inherited Panel1: TPanel
    Width = 1042
    Visible = False
    inherited BitBtn1: TBitBtn
      Left = 880
    end
    inherited BitBtn2: TBitBtn
      Left = 968
    end
  end
  object dbgClients: TcxGrid [2]
    Left = 0
    Top = 73
    Width = 1042
    Height = 464
    Align = alTop
    TabOrder = 2
    LookAndFeel.Kind = lfStandard
    object tvPodotch: TcxGridDBTableView
      OnDblClick = tvPodotchDblClick
      NavigatorButtons.ConfirmDelete = False
      NavigatorButtons.First.Visible = True
      NavigatorButtons.PriorPage.Visible = True
      NavigatorButtons.Prior.Visible = True
      NavigatorButtons.Next.Visible = True
      NavigatorButtons.NextPage.Visible = True
      NavigatorButtons.Last.Visible = True
      NavigatorButtons.Insert.Visible = False
      NavigatorButtons.Append.Visible = False
      NavigatorButtons.Delete.Visible = False
      NavigatorButtons.Edit.Visible = False
      NavigatorButtons.Post.Visible = False
      NavigatorButtons.Cancel.Visible = False
      NavigatorButtons.Refresh.Visible = False
      NavigatorButtons.SaveBookmark.Visible = False
      NavigatorButtons.GotoBookmark.Visible = False
      NavigatorButtons.Filter.Visible = False
      DataController.DataSource = dlgDS
      DataController.Summary.DefaultGroupSummaryItems = <>
      DataController.Summary.FooterSummaryItems = <
        item
          Format = '#,###0'
          Kind = skSum
          FieldName = 'BALANCE'
          Column = tvPodotchBALANCE
          DisplayText = #1054#1073#1097'. '#1089#1091#1084#1084#1072
        end
        item
          Format = '#,###0'
          Kind = skSum
          FieldName = 'DEBET'
          Column = tvPodotchDEBET
        end
        item
          Format = '#,###0'
          Kind = skSum
          FieldName = 'KREDIT'
          Column = tvPodotchKREDIT
        end>
      DataController.Summary.SummaryGroups = <>
      DataController.Summary.Options = [soNullIgnore]
      OptionsBehavior.CellHints = True
      OptionsBehavior.ImmediateEditor = False
      OptionsBehavior.IncSearch = True
      OptionsData.Deleting = False
      OptionsData.Editing = False
      OptionsData.Inserting = False
      OptionsSelection.HideFocusRectOnExit = False
      OptionsSelection.InvertSelect = False
      OptionsSelection.UnselectFocusedRecordOnExit = False
      OptionsView.Navigator = True
      OptionsView.NavigatorOffset = 10
      OptionsView.ColumnAutoWidth = True
      OptionsView.DataRowHeight = 24
      OptionsView.ExpandButtonsForEmptyDetails = False
      OptionsView.Footer = True
      OptionsView.GroupByBox = False
      OptionsView.Indicator = True
      Preview.Visible = True
      Styles.Content = DMInv.cxData
      Styles.IncSearch = DMInv.cxKrasniyText
      Styles.Selection = DMInv.cxJoltiyFon
      Styles.Header = DMInv.cxSiniyText
      object tvPodotchRPTIMEENTER: TcxGridDBColumn
        Caption = #1044#1072#1090#1072' '#1079#1072#1074#1077#1076'.'
        DataBinding.FieldName = 'RPTIMEENTER'
        Width = 120
      end
      object tvPodotchRPDATE: TcxGridDBColumn
        Caption = #1044#1072#1090#1072
        DataBinding.FieldName = 'RPDATE'
        SortIndex = 1
        SortOrder = soAscending
        Width = 80
      end
      object tvPodotchFIO: TcxGridDBColumn
        Caption = #1055#1083#1072#1090#1077#1083#1100#1097#1080#1082'/'#1055#1086#1083#1091#1095#1072#1090#1077#1083#1100
        DataBinding.FieldName = 'FIO'
        SortIndex = 0
        SortOrder = soAscending
        Width = 147
      end
      object tvPodotchDEBET: TcxGridDBColumn
        Caption = #1055#1086#1089#1090#1091#1087#1080#1083#1086
        DataBinding.FieldName = 'DEBET'
        Width = 60
      end
      object tvPodotchKREDIT: TcxGridDBColumn
        Caption = #1054#1090#1076#1072#1085#1086
        DataBinding.FieldName = 'KREDIT'
        Width = 69
      end
      object tvPodotchBALANCE: TcxGridDBColumn
        Caption = #1041#1072#1083#1072#1085#1089' '#1087#1086' '#1086#1087#1077#1088'.'
        DataBinding.FieldName = 'BALANCE'
        Width = 138
      end
      object tvPodotchBALANCE_PREV: TcxGridDBColumn
        Caption = #1041#1072#1083#1072#1085#1089
        DataBinding.FieldName = 'BALANCE_PREV'
        Width = 65
      end
      object tvPodotchKOMMENT: TcxGridDBColumn
        Caption = #1050#1086#1084#1084#1077#1085#1090'.'
        DataBinding.FieldName = 'KOMMENT'
        Width = 53
      end
    end
    object dbgClientsLevel1: TcxGridLevel
      GridView = tvPodotch
    end
  end
  object ToolBar1: TToolBar [3]
    Left = 0
    Top = 45
    Width = 1042
    Height = 28
    ButtonHeight = 26
    Caption = 'ToolBar1'
    Images = DMInv.ilActive
    TabOrder = 3
    object tbMoneyTransfer: TToolButton
      Left = 0
      Top = 2
      Hint = #1055#1077#1088#1077#1076#1072#1095#1072' '#1076#1077#1085#1077#1075
      Caption = 'tbMoneyTransfer'
      ImageIndex = 17
      ParentShowHint = False
      ShowHint = True
      OnClick = tbMoneyTransferClick
    end
    object tbDelPodotch: TToolButton
      Left = 23
      Top = 2
      Hint = #1059#1076#1072#1083#1080#1090#1100' '#1087#1086#1076#1086#1090#1095#1077#1090
      Caption = 'tbDelPodotch'
      ImageIndex = 35
      ParentShowHint = False
      ShowHint = True
      Visible = False
      OnClick = tbDelPodotchClick
    end
    object ToolButton6: TToolButton
      Left = 46
      Top = 2
      Width = 8
      Caption = 'ToolButton6'
      ImageIndex = 14
      Style = tbsSeparator
    end
    object bCurrentBal: TToolButton
      Left = 54
      Top = 2
      Hint = #1055#1086#1076#1086#1090#1095#1077#1090' '#1087#1086' '#1087#1086#1083#1100#1079#1086#1074#1072#1090#1077#1083#1103#1084
      Caption = 'bCurrentBal'
      ImageIndex = 18
      ParentShowHint = False
      ShowHint = True
      OnClick = bCurrentBalClick
    end
    object tbPrint: TToolButton
      Left = 77
      Top = 2
      Hint = #1055#1077#1095#1072#1090#1100' '#1088#1072#1089#1087#1080#1089#1082#1080
      Caption = 'tbPrint'
      ImageIndex = 11
      ParentShowHint = False
      ShowHint = True
      OnClick = tbPrintClick
    end
    object ToolButton1: TToolButton
      Left = 100
      Top = 2
      Width = 8
      Caption = 'ToolButton1'
      ImageIndex = 12
      Style = tbsSeparator
    end
    object ToolButton4: TToolButton
      Left = 108
      Top = 2
      Caption = 'tbExcell'
      ImageIndex = 16
      OnClick = ToolButton4Click
    end
    object ToolButton377: TToolButton
      Left = 131
      Top = 2
      Caption = 'ToolButton377'
      ImageIndex = 13
      Visible = False
      OnClick = ToolButton377Click
    end
    object ToolButton5: TToolButton
      Left = 154
      Top = 2
      Width = 8
      Caption = 'ToolButton5'
      ImageIndex = 14
      Style = tbsSeparator
    end
    object cxLabel1: TcxLabel
      Left = 162
      Top = 6
      Caption = #1056#1072#1089#1093#1086#1076' '#1089#1088#1077#1076#1089#1090#1074
      Style.TextColor = clGray
      Visible = False
    end
    object tbAddSpisanie: TToolButton
      Left = 246
      Top = 2
      Hint = #1057#1086#1079#1076#1072#1090#1100' '#1086#1090#1095#1077#1090' '#1086#1073' '#1080#1089#1087#1086#1083#1100#1079#1086#1074#1072#1085#1085#1099#1093' '#1089#1088#1077#1076#1089#1090#1074#1072#1093' '
      Caption = 'tbAddSpisanie'
      ImageIndex = 28
      ParentShowHint = False
      ShowHint = True
      Visible = False
      OnClick = tbAddSpisanieClick
    end
    object tbEditSpisanie: TToolButton
      Left = 269
      Top = 2
      Hint = #1056#1077#1076#1072#1082#1090#1080#1088#1086#1074#1072#1090#1100' '#1086#1090#1095#1077#1090' '#1086#1073' '#1080#1089#1087#1086#1083#1100#1079#1086#1074#1072#1085#1085#1099#1093' '#1089#1088#1077#1076#1089#1090#1074#1072#1093' '
      Caption = 'tbEditSpisanie'
      ImageIndex = 2
      ParentShowHint = False
      ShowHint = True
      Visible = False
      OnClick = tbEditSpisanieClick
    end
    object tbDelSpisanie: TToolButton
      Left = 292
      Top = 2
      Hint = #1059#1076#1072#1083#1080#1090#1100' '#1086#1090#1095#1077#1090' '#1086#1073' '#1080#1089#1087#1086#1083#1100#1079#1086#1074#1072#1085#1085#1099#1093' '#1089#1088#1077#1076#1089#1090#1074#1072#1093' '
      Caption = 'tbDelSpisanie'
      ImageIndex = 29
      ParentShowHint = False
      ShowHint = True
      Visible = False
      OnClick = tbDelSpisanieClick
    end
    object tbPrintSpisanie: TToolButton
      Left = 315
      Top = 2
      Hint = #1055#1077#1095#1072#1090#1100' '#1086#1090#1095#1077#1090#1072' '#1086#1073' '#1080#1089#1087'. '#1089#1088#1077#1076#1089#1090#1074#1072#1093
      Caption = 'tbPrintSpisanie'
      ImageIndex = 11
      ParentShowHint = False
      ShowHint = True
      Visible = False
      OnClick = tbPrintSpisanieClick
    end
    object Label1: TLabel
      Left = 338
      Top = 2
      Width = 127
      Height = 26
      Alignment = taCenter
      AutoSize = False
      Caption = #1044#1072#1090#1072' '#1087#1086#1089#1090#1091#1087#1083'. '#1089#1088#1077#1076#1089#1090#1074
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object ePodotchDate: TcxButtonEdit
      Tag = 11
      Left = 465
      Top = 3
      ParentFont = False
      Properties.Buttons = <
        item
          Glyph.Data = {
            F6000000424DF600000000000000760000002800000010000000100000000100
            0400000000008000000000000000000000001000000000000000000000000000
            8000008000000080800080000000800080008080000080808000C0C0C0000000
            FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFFFFFFF
            FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
            FFFFFFFFFFF0FFFFFFFFFFFFFF000FFFFFFFFFFFF00000FFFFFFFFFF0000000F
            FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
            FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF}
        end>
      Properties.MaxLength = 0
      Properties.ReadOnly = True
      Properties.OnButtonClick = ePaymentDatePropertiesButtonClick
      Properties.OnChange = ePodotchDatePropertiesChange
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -13
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.LookAndFeel.SkinName = ''
      Style.Shadow = False
      Style.IsFontAssigned = True
      StyleDisabled.LookAndFeel.SkinName = ''
      StyleFocused.LookAndFeel.SkinName = ''
      StyleHot.LookAndFeel.SkinName = ''
      TabOrder = 0
      Width = 211
    end
    object ToolButton2: TToolButton
      Left = 676
      Top = 2
      Width = 8
      Caption = 'ToolButton2'
      ImageIndex = 13
      Style = tbsSeparator
    end
    object Label7: TLabel
      Left = 684
      Top = 2
      Width = 85
      Height = 26
      Alignment = taCenter
      AutoSize = False
      Caption = #1055#1086#1076#1086#1090#1095'. '#1083#1080#1094#1086
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object cxLookupComboBox1: TcxLookupComboBox
      Left = 769
      Top = 2
      ParentFont = False
      Properties.DropDownRows = 15
      Properties.KeyFieldNames = 'PID'
      Properties.ListColumns = <
        item
          Caption = #1060#1048#1054
          FieldName = 'FIO'
        end>
      Properties.ListSource = dsPodotchLitso
      Properties.MaxLength = 0
      Properties.OnEditValueChanged = cxLookupComboBox1PropertiesEditValueChanged
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clWindowText
      Style.Font.Height = -15
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = []
      Style.Shadow = False
      Style.IsFontAssigned = True
      TabOrder = 1
      OnMouseDown = cxLookupComboBox1MouseDown
      Width = 209
    end
    object ToolButton3: TToolButton
      Left = 978
      Top = 2
      Caption = 'ToolButton3'
      ImageIndex = 15
      Visible = False
      OnClick = ToolButton3Click
    end
    object ToolButton7: TToolButton
      Left = 1001
      Top = 2
      Caption = 'ToolButton7'
      ImageIndex = 16
      Visible = False
      OnClick = ToolButton7Click
    end
  end
  object cxSplitter1: TcxSplitter [4]
    Left = 0
    Top = 537
    Width = 1042
    Height = 8
    AlignSplitter = salTop
    Control = dbgClients
  end
  object cxGrid1: TcxGrid [5]
    Left = 0
    Top = 545
    Width = 1042
    Height = 111
    Align = alClient
    TabOrder = 5
    LookAndFeel.Kind = lfStandard
    object cxGridDBTableView1: TcxGridDBTableView
      NavigatorButtons.ConfirmDelete = False
      NavigatorButtons.First.Visible = True
      NavigatorButtons.PriorPage.Visible = True
      NavigatorButtons.Prior.Visible = True
      NavigatorButtons.Next.Visible = True
      NavigatorButtons.NextPage.Visible = True
      NavigatorButtons.Last.Visible = True
      NavigatorButtons.Insert.Visible = False
      NavigatorButtons.Append.Visible = False
      NavigatorButtons.Delete.Visible = False
      NavigatorButtons.Edit.Visible = False
      NavigatorButtons.Post.Visible = False
      NavigatorButtons.Cancel.Visible = False
      NavigatorButtons.Refresh.Visible = False
      NavigatorButtons.SaveBookmark.Visible = False
      NavigatorButtons.GotoBookmark.Visible = False
      NavigatorButtons.Filter.Visible = False
      DataController.DataSource = dsPaymants_Agr
      DataController.Summary.DefaultGroupSummaryItems = <>
      DataController.Summary.FooterSummaryItems = <
        item
          Format = '#,###0'
          Kind = skSum
          FieldName = 'CAMOUNT'
          DisplayText = #1054#1073#1097'. '#1089#1091#1084#1084#1072
        end>
      DataController.Summary.SummaryGroups = <>
      DataController.Summary.Options = [soNullIgnore]
      OptionsBehavior.CellHints = True
      OptionsBehavior.ImmediateEditor = False
      OptionsBehavior.IncSearch = True
      OptionsCustomize.ColumnFiltering = False
      OptionsCustomize.ColumnGrouping = False
      OptionsData.Deleting = False
      OptionsData.Editing = False
      OptionsData.Inserting = False
      OptionsSelection.CellSelect = False
      OptionsSelection.HideFocusRectOnExit = False
      OptionsSelection.InvertSelect = False
      OptionsSelection.UnselectFocusedRecordOnExit = False
      OptionsView.NavigatorOffset = 10
      OptionsView.ColumnAutoWidth = True
      OptionsView.DataRowHeight = 24
      OptionsView.ExpandButtonsForEmptyDetails = False
      OptionsView.Footer = True
      OptionsView.GroupByBox = False
      OptionsView.Indicator = True
      Preview.Visible = True
      Styles.Content = DMInv.cxData
      Styles.IncSearch = DMInv.cxKrasniyText
      Styles.Selection = DMInv.cxJoltiyFon
      Styles.Header = DMInv.cxSiniyText
      object cxGridDBTableView1PAID: TcxGridDBColumn
        Caption = 'ID '#1087#1083#1072#1090#1077#1078#1072
        DataBinding.FieldName = 'PAID'
        Width = 79
      end
      object cxGridDBTableView1P_RECIPIENT: TcxGridDBColumn
        Caption = #1055#1086#1083#1091#1095'. '#1091#1089#1083#1091#1075
        DataBinding.FieldName = 'P_RECIPIENT'
        Width = 450
      end
      object cxGridDBTableView1PLAT: TcxGridDBColumn
        Caption = #1055#1083#1072#1090#1077#1083#1100#1097#1080#1082
        DataBinding.FieldName = 'PLAT'
        Width = 371
      end
      object cxGridDBTableView1PAAMOUNT: TcxGridDBColumn
        Caption = #1057#1091#1084#1084#1072
        DataBinding.FieldName = 'PAAMOUNT'
        Width = 126
      end
    end
    object cxGridLevel1: TcxGridLevel
      GridView = cxGridDBTableView1
    end
  end
  object dbgPS: TcxGrid [6]
    Left = 0
    Top = 656
    Width = 1042
    Height = 83
    Align = alBottom
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 6
    LookAndFeel.Kind = lfStandard
    object tvPS: TcxGridDBTableView
      NavigatorButtons.ConfirmDelete = False
      NavigatorButtons.First.Visible = True
      NavigatorButtons.PriorPage.Visible = True
      NavigatorButtons.Prior.Visible = True
      NavigatorButtons.Next.Visible = True
      NavigatorButtons.NextPage.Visible = True
      NavigatorButtons.Last.Visible = True
      NavigatorButtons.Insert.Visible = False
      NavigatorButtons.Append.Visible = False
      NavigatorButtons.Delete.Visible = False
      NavigatorButtons.Edit.Visible = False
      NavigatorButtons.Post.Visible = False
      NavigatorButtons.Cancel.Visible = False
      NavigatorButtons.Refresh.Visible = False
      NavigatorButtons.SaveBookmark.Visible = False
      NavigatorButtons.GotoBookmark.Enabled = False
      NavigatorButtons.GotoBookmark.Visible = False
      NavigatorButtons.Filter.Visible = False
      FilterBox.CustomizeDialog = False
      FilterBox.Visible = fvNever
      DataController.DataSource = dsSpisanie
      DataController.Summary.DefaultGroupSummaryItems = <>
      DataController.Summary.FooterSummaryItems = <
        item
          Format = '#,###0'
          Kind = skSum
          FieldName = 'RPSSUMMA'
          Column = tvPSRPSSUMMA
        end>
      DataController.Summary.SummaryGroups = <>
      DataController.Summary.Options = [soNullIgnore]
      OptionsBehavior.CellHints = True
      OptionsBehavior.FocusFirstCellOnNewRecord = True
      OptionsBehavior.IncSearch = True
      OptionsCustomize.ColumnFiltering = False
      OptionsCustomize.ColumnGrouping = False
      OptionsData.Appending = True
      OptionsData.Deleting = False
      OptionsData.Editing = False
      OptionsData.Inserting = False
      OptionsView.NavigatorOffset = 5
      OptionsView.CellAutoHeight = True
      OptionsView.CellTextMaxLineCount = 3
      OptionsView.ColumnAutoWidth = True
      OptionsView.ExpandButtonsForEmptyDetails = False
      OptionsView.Footer = True
      OptionsView.GroupByBox = False
      OptionsView.HeaderEndEllipsis = True
      OptionsView.Indicator = True
      OptionsView.ShowColumnFilterButtons = sfbAlways
      Styles.Content = DMInv.cxData
      Styles.IncSearch = DMInv.cxGreenText
      Styles.Header = DMInv.cxSiniyText
      object tvPSSDNAME: TcxGridDBColumn
        Caption = #1053#1072#1080#1084#1077#1085#1086#1074#1072#1085#1080#1077
        DataBinding.FieldName = 'SDNAME'
        Width = 42
      end
      object tvPSSDID_ED_IZM: TcxGridDBColumn
        Caption = #1045#1076'. '#1080#1079#1084'.'
        DataBinding.FieldName = 'ED_IZM'
        Width = 26
      end
      object tvPSRPSCENA: TcxGridDBColumn
        Caption = #1062#1077#1085#1072
        DataBinding.FieldName = 'RPSCENA'
        Width = 20
      end
      object tvPSRPSKOL: TcxGridDBColumn
        Caption = #1050#1086#1083#1080#1095'.'
        DataBinding.FieldName = 'RPSKOL'
        Width = 22
      end
      object tvPSRPSSUMMA: TcxGridDBColumn
        Caption = #1057#1091#1084#1084#1072
        DataBinding.FieldName = 'RPSSUMMA'
        Width = 20
      end
      object tvPSPREDOSTAVIL: TcxGridDBColumn
        Caption = #1050#1090#1086' '#1087#1088#1077#1076#1086#1089#1090#1072#1074#1080#1083' '#1091#1089#1083#1091#1075#1091
        DataBinding.FieldName = 'PREDOSTAVIL'
        Width = 69
      end
      object tvPSRPSSPEEDOMETR: TcxGridDBColumn
        Caption = #1055#1088#1086#1073#1077#1075' '#1072#1074#1090#1086
        DataBinding.FieldName = 'RPSSPEEDOMETR'
        Width = 41
      end
      object tvPSRPSNOTE: TcxGridDBColumn
        Caption = #1050#1086#1084#1084#1077#1085#1090'.'
        DataBinding.FieldName = 'RPSNOTE'
        Width = 34
      end
      object tvPSPOTREBITEL_OBJECT: TcxGridDBColumn
        Caption = #1055#1086#1076#1088#1072#1079#1076#1077#1083#1077#1085#1080#1077'/'#1086#1073#1098#1077#1082#1090
        DataBinding.FieldName = 'POTREBITEL_OBJECT'
        Width = 85
      end
      object tvPSPOTREBITEL_FIO: TcxGridDBColumn
        Caption = #1055#1086#1090#1088#1077#1073#1080#1090#1077#1083#1100' '#1060#1048#1054
        DataBinding.FieldName = 'POTREBITEL_FIO'
        Width = 78
      end
      object tvPSSTATJA_RASHODOV: TcxGridDBColumn
        Caption = #1057#1090#1072#1090#1100#1103' '#1088#1072#1089#1093#1086#1076#1086#1074
        DataBinding.FieldName = 'STATJA_RASHODOV'
        Width = 94
      end
    end
    object dbgPSLevel1: TcxGridLevel
      GridView = tvPS
    end
  end
  inherited dlgDS: TDataSource
    DataSet = qCommon
    OnDataChange = dlgDSDataChange
  end
  object qCommon: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    CachedUpdates = True
    SQL.Strings = (
      'SELECT rp.rpid, rp.rpdate, rp.rptimeenter,'
      '       CASE rp.ppid'
      '         WHEN 1 THEN '#39#1041#1072#1085#1082#39
      
        '         WHEN 2 THEN p1.plastname || '#39' '#39' || SUBSTRING(p1.pname F' +
        'ROM 1 FOR 1) || '#39'. '#39' || COALESCE(SUBSTRING(p1.ppatronymic FROM 1' +
        ' FOR 1) || '#39'.'#39', '#39' '#39')'
      
        '         WHEN 3 THEN p1.plastname || '#39' '#39' || SUBSTRING(p1.pname F' +
        'ROM 1 FOR 1) || '#39'. '#39' || COALESCE(SUBSTRING(p1.ppatronymic FROM 1' +
        ' FOR 1) || '#39'.'#39', '#39' '#39')'
      '         ELSE CASE pp1.pptype'
      
        '                WHEN 4 THEN (p.plastname || '#39' '#39' || SUBSTRING(p.p' +
        'name FROM 1 FOR 1) || '#39'. '#39' || COALESCE(SUBSTRING(p.ppatronymic F' +
        'ROM 1 FOR 1) || '#39'.'#39', '#39' '#39'))'
      '                WHEN 5 THEN jl.jlegalname'
      '              END'
      '       END AS fio,'
      
        '       rp.rpsumma AS debet, CAST('#39'0'#39' AS NUMERIC(18,2)) AS kredit' +
        ', '#39#1044#1077#1073#1077#1090#39' AS type_oper,'
      '       (SELECT SUM(balance1.sum_)'
      '        FROM (SELECT COALESCE(SUM(rp1.rpsumma), 0) AS sum_'
      '              FROM raspred_podotch rp1'
      
        '              INNER JOIN person_podotch pp1 ON pp1.ppid = rp1.pp' +
        'id_to'
      '              WHERE rp1.rpid <= rp.rpid'
      '                    AND pp1.PPTYPE = 4'
      '                    AND'
      '                    rp1.rpisdelete IS NULL AND'
      '                    pp1.pp_id = :pid'
      '              UNION ALL'
      
        '              SELECT COALESCE(SUM(rp1.rpsumma) * (-1), 0) AS sum' +
        '_'
      '              FROM raspred_podotch rp1'
      
        '              INNER JOIN person_podotch pp1 ON pp1.ppid = rp1.pp' +
        'id'
      '              WHERE rp1.rpid <= rp.rpid'
      '                    AND pp1.PPTYPE = 4'
      '                    AND'
      '                    rp1.rpisdelete IS NULL AND'
      
        '                    pp1.pp_id = :pid) AS balance1) AS balance_pr' +
        'ev, rp.rpsumma AS balance,'
      
        '       COALESCE(rp.rpnote, '#39' '#39') AS komment, rp.ppid, rp.PPID_TO,' +
        ' rp.RPSUMMA, RP.RPDATE,'
      '       RP.RPTYPE, RP.RPFORM,'
      
        '       (p.plastname || '#39' '#39' || SUBSTRING(p.pname FROM 1 FOR 1) ||' +
        ' '#39'. '#39' || COALESCE(SUBSTRING(p.ppatronymic FROM 1 FOR 1) || '#39'.'#39', ' +
        #39' '#39')) AS fio_otkogo,'
      
        '       (p1.plastname || '#39' '#39' || SUBSTRING(p1.pname FROM 1 FOR 1) ' +
        '|| '#39'. '#39' || COALESCE(SUBSTRING(p1.ppatronymic FROM 1 FOR 1) || '#39'.' +
        #39', '#39' '#39')) AS fio_komu,'
      '       RP.PNUM'
      'FROM raspred_podotch rp'
      'LEFT OUTER JOIN person_podotch pp ON pp.ppid = rp.ppid_to'
      'LEFT OUTER JOIN person_podotch pp1 ON pp1.ppid = rp.ppid'
      'LEFT OUTER JOIN people p ON p.pid = pp1.pp_id'
      'LEFT OUTER JOIN jurlitsa jl ON jl.jlid = pp1.pp_id'
      'LEFT OUTER JOIN people p1 ON p1.pid = pp.pp_id'
      'WHERE pp.pp_id = :pid AND'
      '      rp.rpisdelete IS NULL AND'
      '      pp.pptype = 4'
      ''
      '      AND'
      '      CAST(rp.rpdate AS DATE) BETWEEN :datebegin AND :dateend'
      'UNION'
      'SELECT rp.rpid, rp.rpdate, rp.rptimeenter,'
      '       CASE rp.ppid_to'
      '         WHEN 0 THEN '#39#1057#1087#1080#1089#1072#1085#1080#1077#39
      '         WHEN 1 THEN '#39#1041#1072#1085#1082#39
      
        '         WHEN 2 THEN p1.plastname || '#39' '#39' || SUBSTRING(p1.pname F' +
        'ROM 1 FOR 1) || '#39'. '#39' || COALESCE(SUBSTRING(p1.ppatronymic FROM 1' +
        ' FOR 1) || '#39'.'#39', '#39' '#39')'
      
        '         WHEN 3 THEN p1.plastname || '#39' '#39' || SUBSTRING(p1.pname F' +
        'ROM 1 FOR 1) || '#39'. '#39' || COALESCE(SUBSTRING(p1.ppatronymic FROM 1' +
        ' FOR 1) || '#39'.'#39', '#39' '#39')'
      '         ELSE CASE pp1.pptype'
      
        '                WHEN 4 THEN (p.plastname || '#39' '#39' || SUBSTRING(p.p' +
        'name FROM 1 FOR 1) || '#39'. '#39' || COALESCE(SUBSTRING(p.ppatronymic F' +
        'ROM 1 FOR 1) || '#39'.'#39', '#39' '#39'))'
      '                WHEN 5 THEN jl.jlegalname'
      '              END'
      '       END AS fio,'
      
        '       CAST('#39'0'#39' AS NUMERIC(18,2)) AS debet, rp.rpsumma AS kredit' +
        ', '#39#1050#1088#1077#1076#1080#1090#39' AS type_oper,'
      '       (SELECT SUM(balance1.sum_)'
      '        FROM (SELECT COALESCE(SUM(rp1.rpsumma), 0) AS sum_'
      '              FROM raspred_podotch rp1'
      
        '              INNER JOIN person_podotch pp1 ON pp1.ppid = rp1.pp' +
        'id_to'
      '              WHERE rp1.rpid <= rp.rpid AND'
      '                    rp1.rptype = 0 AND'
      '                    rp1.rpisdelete IS NULL AND'
      '                    pp1.pp_id = :pid'
      '                    AND pp1.PPTYPE = 4'
      '              UNION ALL'
      
        '              SELECT COALESCE(SUM(rp1.rpsumma) * (-1), 0) AS sum' +
        '_'
      '              FROM raspred_podotch rp1'
      
        '              INNER JOIN person_podotch pp1 ON pp1.ppid = rp1.pp' +
        'id'
      '              WHERE rp1.rpid <= rp.rpid AND'
      '                    rp1.rptype = 1 AND'
      '                    rp1.rpisdelete IS NULL AND'
      '                     pp1.PPTYPE = 4 AND'
      
        '                    pp1.pp_id = :pid) AS balance1) AS balance_pr' +
        'ev,'
      
        '       ((-1) * rp.rpsumma) AS balance, rp.rpnote AS komment, rp.' +
        'ppid, rp.ppid_to, rp.RPSUMMA, RP.RPDATE,'
      '       RP.RPTYPE, RP.RPFORM,'
      
        '       (p1.plastname || '#39' '#39' || SUBSTRING(p1.pname FROM 1 FOR 1) ' +
        '|| '#39'. '#39' || COALESCE(SUBSTRING(p1.ppatronymic FROM 1 FOR 1) || '#39'.' +
        #39', '#39' '#39')) AS fio_otkogo,'
      
        '       (p.plastname || '#39' '#39' || SUBSTRING(p.pname FROM 1 FOR 1) ||' +
        ' '#39'. '#39' || COALESCE(SUBSTRING(p.ppatronymic FROM 1 FOR 1) || '#39'.'#39', ' +
        #39' '#39')) AS fio_komu,'
      '       RP.PNUM'
      'FROM raspred_podotch rp'
      'LEFT OUTER JOIN person_podotch pp ON pp.ppid = rp.ppid'
      'LEFT OUTER JOIN person_podotch pp1 ON pp1.ppid = rp.ppid_to'
      'LEFT OUTER JOIN people p ON p.pid = pp1.pp_id'
      'LEFT OUTER JOIN jurlitsa jl ON jl.jlid = pp1.pp_id'
      'LEFT OUTER JOIN people p1 ON p1.pid = pp.pp_id'
      'WHERE pp.pp_id = :pid AND'
      '      rp.rpisdelete IS NULL AND'
      '      pp.pptype = 4'
      ''
      '      AND'
      
        '      CAST(rp.rpdate AS DATE) BETWEEN :datebegin AND :dateend   ' +
        ' '
      ''
      '')
    UpdateObject = quCommon
    GeneratorField.Field = 'RPID'
    GeneratorField.Generator = 'GEN_RASPRED_PODOTCH_ID'
    Left = 288
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'pid'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'pid'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'pid'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'datebegin'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'dateend'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'pid'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'pid'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'pid'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'datebegin'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'dateend'
        ParamType = ptUnknown
      end>
    object qCommonFIO: TIBStringField
      FieldName = 'FIO'
      ProviderFlags = []
      Size = 769
    end
    object qCommonRPDATE: TDateField
      FieldName = 'RPDATE'
      Origin = '"RASPRED_PODOTCH"."RPDATE"'
    end
    object qCommonDEBET: TIBBCDField
      FieldName = 'DEBET'
      Origin = '"RASPRED_PODOTCH"."RPSUMMA"'
      DisplayFormat = '#,###0'
      Precision = 18
      Size = 2
    end
    object qCommonKREDIT: TIBBCDField
      FieldName = 'KREDIT'
      ProviderFlags = []
      DisplayFormat = '#,###0'
      Precision = 18
      Size = 2
    end
    object qCommonTYPE_OPER: TIBStringField
      FieldName = 'TYPE_OPER'
      ProviderFlags = []
      FixedChar = True
      Size = 6
    end
    object qCommonBALANCE: TIBBCDField
      FieldName = 'BALANCE'
      ProviderFlags = []
      DisplayFormat = '#,###0'
      Precision = 18
      Size = 2
    end
    object qCommonBALANCE_PREV: TIBBCDField
      FieldName = 'BALANCE_PREV'
      ProviderFlags = []
      DisplayFormat = '#,###0'
      Precision = 18
      Size = 2
    end
    object qCommonRPTIMEENTER: TDateTimeField
      FieldName = 'RPTIMEENTER'
      Origin = '"RASPRED_PODOTCH"."RPTIMEENTER"'
    end
    object qCommonKOMMENT: TIBStringField
      FieldName = 'KOMMENT'
      ProviderFlags = []
      Size = 255
    end
    object qCommonRPID: TIntegerField
      FieldName = 'RPID'
      Origin = '"RASPRED_PODOTCH"."RPID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qCommonPPID: TIntegerField
      FieldName = 'PPID'
      Origin = '"RASPRED_PODOTCH"."PPID"'
    end
    object qCommonPPID_TO: TIntegerField
      FieldName = 'PPID_TO'
      Origin = '"RASPRED_PODOTCH"."PPID_TO"'
    end
    object qCommonRPSUMMA: TIBBCDField
      FieldName = 'RPSUMMA'
      Origin = '"RASPRED_PODOTCH"."RPSUMMA"'
      Precision = 18
      Size = 2
    end
    object qCommonRPDATE1: TDateField
      FieldName = 'RPDATE1'
      Origin = '"RASPRED_PODOTCH"."RPDATE"'
    end
    object qCommonRPTYPE: TIntegerField
      FieldName = 'RPTYPE'
      Origin = '"RASPRED_PODOTCH"."RPTYPE"'
    end
    object qCommonRPFORM: TIntegerField
      FieldName = 'RPFORM'
      Origin = '"RASPRED_PODOTCH"."RPFORM"'
    end
    object qCommonFIO_OTKOGO: TIBStringField
      FieldName = 'FIO_OTKOGO'
      ProviderFlags = []
      Size = 769
    end
    object qCommonFIO_KOMU: TIBStringField
      FieldName = 'FIO_KOMU'
      ProviderFlags = []
      Size = 769
    end
    object qCommonPNUM: TIntegerField
      FieldName = 'PNUM'
      Origin = '"RASPRED_PODOTCH"."PNUM"'
    end
  end
  object dsRPS: TDataSource
    DataSet = qRPS
    Left = 272
    Top = 464
  end
  object qRPS: TIBQuery
    Tag = 2
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      
        'SELECT IIF(C.CTYPE = 2,'#39' '#1055#1083#1072#1090#1072' '#1079#1072' '#1087#1077#1088#1077#1095#1080#1089#1083#1077#1085#1080#1077' '#1076#1077#1085#1077#1075' '#1085#1072' '#1088'/'#1089' '#1086#1073#1088#1072 +
        #1079#1086#1074#1072#1090#1077#1083#1100#1085#1086#1075#1086' '#1091#1095#1088#1077#1078#1076#1077#1085#1080#1103' '#1095#1077#1088#1077#1079' '#1073#1072#1085#1082#39', ST.STNAME) AS STNAME,'
      'C.CAMOUNT,'
      '(p1.PLASTNAME||'#39' '#39'||SUBSTRING(p1.PNAME FROM 1 FOR 1 )||'#39'. '#39'||'
      
        'COALESCE(SUBSTRING(p1.PPATRONYMIC FROM 1 FOR 1)||'#39'.'#39','#39' '#39')) AS pu' +
        ', sd2.SDNAME as osn_podr'
      'FROM COMMON C'
      'INNER JOIN COMMON_SERV CS ON CS.CSID = C.CSID'
      'INNER JOIN SERVICES S ON S.SCID = C.SCID'
      'INNER JOIN PEOPLE P1 ON P1.PID = CS.PID_POLUCH'
      'INNER JOIN SERVICES_TYPE ST ON ST.STID = S.STID'
      
        'LEFT OUTER JOIN deti_podrazd dp ON dp.pid = CS.PID_POLUCH AND CU' +
        'RRENT_DATE BETWEEN CAST(dp.dpdatein AS DATE) AND COALESCE(CAST(d' +
        'p.dpdateout AS DATE), CURRENT_DATE + 3650)'
      'LEFT OUTER JOIN sys_dic sd2 ON sd2.sdid = dp.sdid'
      'WHERE CS.RPID = :RPID and CS.csisdelete is null')
    Left = 312
    Top = 465
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'RPID'
        ParamType = ptUnknown
      end>
    object qRPSSTNAME: TIBStringField
      FieldName = 'STNAME'
      ProviderFlags = []
      Size = 255
    end
    object qRPSPU: TIBStringField
      FieldName = 'PU'
      ProviderFlags = []
      Size = 769
    end
    object qRPSCAMOUNT: TIBBCDField
      FieldName = 'CAMOUNT'
      Origin = '"COMMON"."CAMOUNT"'
      DisplayFormat = '#,###0'
      Precision = 18
      Size = 2
    end
    object qRPSOSN_PODR: TIBStringField
      FieldName = 'OSN_PODR'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
  end
  object dsPodotchLitso: TDataSource
    DataSet = qPodotchLitso
    Left = 488
    Top = 13
  end
  object qPodotchLitso: TIBQuery
    Tag = 1
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      '--'#1095#1077#1083#1086#1074#1077#1082#1080
      
        'SELECT P.PID, P.PID as USERMONEY, PP.PPID, P.PLASTNAME||'#39' '#39'||SUB' +
        'STRING(P.PNAME FROM 1 FOR 1 )||'#39'. '#39'||'
      
        '        COALESCE(SUBSTRING(P.PPATRONYMIC FROM 1 FOR 1)||'#39'.'#39','#39' '#39')' +
        ' AS fio'
      'FROM  PERSON_PODOTCH PP'
      '--INNER JOIN USERMONEY UM ON UM.PID = PP.PP_ID'
      'INNER JOIN PEOPLE P ON P.PID = PP.PP_ID'
      'WHERE PP.PPTYPE = 4'
      'order by 4')
    GeneratorField.Field = 'RPID'
    Left = 528
    Top = 13
    object qPodotchLitsoPPID: TIntegerField
      FieldName = 'PPID'
      Origin = '"PERSON_PODOTCH"."PPID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPodotchLitsoFIO: TIBStringField
      FieldName = 'FIO'
      ProviderFlags = []
      Size = 769
    end
    object qPodotchLitsoPID: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPodotchLitsoUSERMONEY: TIntegerField
      FieldName = 'USERMONEY'
      Origin = '"PEOPLE"."PID"'
      Required = True
    end
  end
  object SD1: TSaveDialog
    InitialDir = 'c:\'
    Options = [ofOverwritePrompt, ofHideReadOnly, ofEnableSizing]
    Left = 48
    Top = 96
  end
  object qCurBal: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT p1.PLASTNAME||'#39' '#39'||SUBSTRING(p1.PNAME FROM 1 FOR 1 )||'#39'. ' +
        #39'||'
      
        'COALESCE(SUBSTRING(p1.PPATRONYMIC FROM 1 FOR 1)||'#39'.'#39','#39' '#39') AS PP,' +
        ' SUM(main.s) AS summa'
      'FROM'
      '('
      'SELECT PP1.PP_ID, '#39'0'#39' AS prihod, SUM(RP.RPSUMMA) AS s'
      'FROM RASPRED_PODOTCH RP'
      'INNER JOIN PERSON_PODOTCH PP1 ON PP1.PPID = RP.PPID_TO'
      'INNER JOIN USERMONEY UM ON UM.PID = PP1.PP_ID'
      'WHERE RP.RPISDELETE IS NULL'
      '   -- AND RP.RPTYPE = 0'
      '    AND CAST(RP.RPDATE AS DATE) >= :data'
      'GROUP BY 1,2'
      'UNION ALL'
      'SELECT PP1.PP_ID, '#39'1'#39' AS prihod, (0 - SUM(RP.RPSUMMA)) AS s'
      'FROM RASPRED_PODOTCH RP'
      'INNER JOIN PERSON_PODOTCH PP1 ON PP1.PPID = RP.PPID'
      'INNER JOIN USERMONEY UM ON UM.PID = PP1.PP_ID'
      'WHERE RP.RPISDELETE IS NULL'
      '   -- AND RP.RPTYPE = 1'
      'AND CAST(RP.RPDATE AS DATE) >= :data'
      'GROUP BY 1,2) AS main'
      'INNER JOIN PEOPLE P1 ON P1.PID = main.PP_ID'
      'GROUP BY 1')
    Left = 168
    Top = 112
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'data'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'data'
        ParamType = ptUnknown
      end>
    object qCurBalPP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 769
    end
    object qCurBalSUMMA: TIBBCDField
      FieldName = 'SUMMA'
      ProviderFlags = []
      Precision = 18
      Size = 2
    end
  end
  object quCommon: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  RPID,'
      '  RPDATE,'
      '  PPID,'
      '  RPSUMMA,'
      '  RPUSERENTER,'
      '  RPTIMEENTER,'
      '  RPUSEREDIT,'
      '  RPTIMEEDIT,'
      '  PPID_TO,'
      '  RPTYPE,'
      '  RPISDELETE,'
      '  CSID,'
      '  RPNOTE,'
      '  RPFORM,'
      '  BPID,'
      '  SDID,'
      'PNUM'
      'from RASPRED_PODOTCH '
      'where'
      '  RPID = :RPID')
    ModifySQL.Strings = (
      'update RASPRED_PODOTCH'
      'set'
      '  BPID = :BPID,'
      '  CSID = :CSID,'
      '  PPID = :PPID,'
      '  PPID_TO = :PPID_TO,'
      '  RPDATE = :RPDATE,'
      '  RPFORM = :RPFORM,'
      '  RPID = :RPID,'
      '  RPISDELETE = :RPISDELETE,'
      '  RPNOTE = :RPNOTE,'
      '  RPSUMMA = :RPSUMMA,'
      '  RPTYPE = :RPTYPE'
      'PNUM = :PNUM'
      ''
      'where'
      '  RPID = :OLD_RPID')
    InsertSQL.Strings = (
      'insert into RASPRED_PODOTCH'
      
        '  (BPID, CSID, PPID, PPID_TO, RPDATE, RPFORM, RPID, RPISDELETE, ' +
        'RPNOTE, '
      '   RPSUMMA, RPTYPE, PNUM)'
      'values'
      
        '  (:BPID, :CSID, :PPID, :PPID_TO, :RPDATE, :RPFORM, :RPID, :RPIS' +
        'DELETE, '
      '   :RPNOTE, :RPSUMMA, :RPTYPE, :PNUM)')
    DeleteSQL.Strings = (
      'update raspred_podotch'
      'set'
      '  RPISDELETE = 1'
      'where'
      '  RPID = :OLD_RPID')
    Left = 320
  end
  object qSpisanie: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      
        'SELECT RPS.*, SD.SDNAME, (COALESCE(jl.JLOPF,'#39' '#39')||'#39' '#39'||'#39'"'#39'||JL.J' +
        'LEGALNAME||'#39'"'#39')  AS predostavil,'
      'sd4.SDNAME AS potrebitel_object,'
      '(COALESCE(jl1.JLOPF,'#39' '#39')||'#39' '#39'||'#39'"'#39'||JL1.JLEGALNAME||'#39'"'#39')'
      'AS potrebitel_fio,'
      'sd5.SDNAME AS statja_rashodov,'
      '    sd2.SDNAME AS ed_izm,'
      '    sd3.SDNAME AS doc'
      'FROM RP_SERVICES RPS'
      'INNER JOIN RASPRED_PODOTCH rp ON rp.RPID = rps.RPID'
      'INNER JOIN SYS_DIC SD ON SD.SDID = RPS.SDID'
      'LEFT OUTER JOIN SYS_DIC SD2 ON SD2.SDID = RPS.SDID_ED_IZM'
      'LEFT OUTER JOIN SYS_DIC SD3 ON SD3.SDID = RP.SDID_DOC'
      
        'LEFT OUTER JOIN SYS_DIC SD4 ON SD4.SDID = RPS.SDID_POTREBITEL_OB' +
        'JECT'
      
        'LEFT OUTER JOIN SYS_DIC SD5 ON SD5.SDID = RPS.SDID_STATJA_RASHOD' +
        'OV'
      'LEFT OUTER JOIN DOLJNOST d ON d.DOLID = RPS.DOLID_POTREBITEL'
      'LEFT OUTER JOIN JURLITSA jl ON jl.JLID = RP.JLID'
      'LEFT OUTER JOIN JURLITSA jl1 ON jl1.JLID = RPS.JLID_POTREBITEL'
      'WHERE RPS.RPID = :RPID AND RPS.RPSISDELETE IS NULL'
      ''
      ''
      '')
    GeneratorField.Field = 'RPSID'
    Left = 592
    Top = 600
    ParamData = <
      item
        DataType = ftInteger
        Name = 'RPID'
        ParamType = ptUnknown
        Size = 4
      end>
    object qSpisanieRPSID: TIntegerField
      FieldName = 'RPSID'
      Origin = '"RP_SERVICES"."RPSID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qSpisanieRPID: TIntegerField
      FieldName = 'RPID'
      Origin = '"RP_SERVICES"."RPID"'
    end
    object qSpisanieSDID: TIntegerField
      FieldName = 'SDID'
      Origin = '"RP_SERVICES"."SDID"'
    end
    object qSpisanieRPSSUMMA: TIBBCDField
      FieldName = 'RPSSUMMA'
      Origin = '"RP_SERVICES"."RPSSUMMA"'
      Precision = 18
      Size = 2
    end
    object qSpisanieRPSUSERENTER: TIBStringField
      FieldName = 'RPSUSERENTER'
      Origin = '"RP_SERVICES"."RPSUSERENTER"'
      Size = 40
    end
    object qSpisanieRPSTIMEENTER: TDateTimeField
      FieldName = 'RPSTIMEENTER'
      Origin = '"RP_SERVICES"."RPSTIMEENTER"'
    end
    object qSpisanieRPSUSEREDIT: TIBStringField
      FieldName = 'RPSUSEREDIT'
      Origin = '"RP_SERVICES"."RPSUSEREDIT"'
      Size = 40
    end
    object qSpisanieRPSTIMEEDIT: TDateTimeField
      FieldName = 'RPSTIMEEDIT'
      Origin = '"RP_SERVICES"."RPSTIMEEDIT"'
    end
    object qSpisanieSDID_ED_IZM: TIntegerField
      FieldName = 'SDID_ED_IZM'
      Origin = '"RP_SERVICES"."SDID_ED_IZM"'
    end
    object qSpisanieRPSKOL: TIBBCDField
      FieldName = 'RPSKOL'
      Origin = '"RP_SERVICES"."RPSKOL"'
      Precision = 18
      Size = 2
    end
    object qSpisanieRPSISDELETE: TIntegerField
      FieldName = 'RPSISDELETE'
      Origin = '"RP_SERVICES"."RPSISDELETE"'
    end
    object qSpisanieRPSCENA: TIBBCDField
      FieldName = 'RPSCENA'
      Origin = '"RP_SERVICES"."RPSCENA"'
      Precision = 18
      Size = 2
    end
    object qSpisanieRPSNOTE: TIBStringField
      FieldName = 'RPSNOTE'
      Origin = '"RP_SERVICES"."RPSNOTE"'
      Size = 255
    end
    object qSpisanieRPSSPEEDOMETR: TIBBCDField
      FieldName = 'RPSSPEEDOMETR'
      Origin = '"RP_SERVICES"."RPSSPEEDOMETR"'
      Precision = 18
      Size = 2
    end
    object qSpisanieSDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qSpisanieED_IZM: TIBStringField
      FieldName = 'ED_IZM'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qSpisaniePOTREBITEL_OBJECT: TIBStringField
      FieldName = 'POTREBITEL_OBJECT'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qSpisaniePOTREBITEL_FIO: TIBStringField
      FieldName = 'POTREBITEL_FIO'
      ProviderFlags = []
      Size = 769
    end
    object qSpisanieSTATJA_RASHODOV: TIBStringField
      FieldName = 'STATJA_RASHODOV'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qSpisaniePREDOSTAVIL: TIBStringField
      FieldName = 'PREDOSTAVIL'
      ProviderFlags = []
      Size = 268
    end
  end
  object dsSpisanie: TDataSource
    DataSet = qSpisanie
    Left = 544
    Top = 600
  end
  object qIsZarplata: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'WITH RECURSIVE tree (sdname, sdid, sdparid) AS (SELECT sd.sdname' +
        ', sd.sdid, sd.sdparid'
      
        '                                                                ' +
        '    FROM sys_dic sd'
      
        '                                                                ' +
        '    WHERE sd.SDPARID = 7692'
      
        '                                                                ' +
        '    UNION ALL'
      
        '                                                                ' +
        '    SELECT sd1.sdname, sd1.sdid, sd1.sdparid'
      
        '                                                                ' +
        '    FROM sys_dic sd1'
      
        '                                                                ' +
        '    INNER JOIN tree t ON t.sdid = sd1.sdparid)'
      'SELECT sdid'
      ' FROM tree t'
      ' WHERE t.sdid = :sdid')
    GeneratorField.Field = 'SDID'
    Left = 288
    Top = 584
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'sdid'
        ParamType = ptUnknown
      end>
  end
  object frReport: TfrxReport
    Version = '4.9'
    DotMatrixReport = False
    IniFile = '\Software\Fast Reports'
    PreviewOptions.Buttons = [pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind, pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator, pbExportQuick]
    PreviewOptions.Zoom = 1.000000000000000000
    PrintOptions.Printer = 'Default'
    PrintOptions.PrintOnSheet = 0
    ReportOptions.CreateDate = 41044.725581956000000000
    ReportOptions.LastChange = 41044.736675520830000000
    ScriptLanguage = 'PascalScript'
    ScriptText.Strings = (
      ''
      'begin'
      ''
      'end.')
    Left = 592
    Top = 336
    Datasets = <
      item
        DataSet = frCommon
        DataSetName = 'Common'
      end>
    Variables = <>
    Style = <>
    object Data: TfrxDataPage
      Height = 1000.000000000000000000
      Width = 1000.000000000000000000
    end
    object Page1: TfrxReportPage
      PaperWidth = 210.000000000000000000
      PaperHeight = 297.000000000000000000
      PaperSize = 9
      LeftMargin = 10.000000000000000000
      RightMargin = 10.000000000000000000
      TopMargin = 10.000000000000000000
      BottomMargin = 10.000000000000000000
      object ReportTitle1: TfrxReportTitle
        Height = 317.480520000000000000
        Top = 18.897650000000000000
        Width = 718.110700000000000000
        object Memo1: TfrxMemoView
          Align = baWidth
          Top = 3.779530000000001000
          Width = 718.110700000000000000
          Height = 26.456710000000000000
          ShowHint = False
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -21
          Font.Name = 'Arial'
          Font.Style = []
          HAlign = haCenter
          Memo.UTF8 = (
            
              #1056#160#1056#176#1057#1027#1056#1111#1056#1105#1057#1027#1056#1108#1056#176' '#1056#1030' '#1056#1111#1056#181#1057#1026#1056#181#1056#1169#1056#176#1057#8225#1056#181' '#1057#1027#1057#1026#1056#181#1056#1169#1057#1027#1057#8218#1056#1030' '#1056#183#1056#176' [Common' +
              '."RPDATE"]')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo2: TfrxMemoView
          Align = baWidth
          Top = 45.354360000000000000
          Width = 718.110700000000000000
          Height = 26.456710000000000000
          ShowHint = False
          DisplayFormat.FormatStr = '%2.0n'
          DisplayFormat.Kind = fkNumeric
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -16
          Font.Name = 'Times New Roman'
          Font.Style = []
          Memo.UTF8 = (
            #1056#1038#1057#1107#1056#1112#1056#1112#1056#176':  [Common."KREDIT"] '#1057#1026#1057#1107#1056#177'.')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo3: TfrxMemoView
          Align = baWidth
          Top = 86.929190000000000000
          Width = 718.110700000000000000
          Height = 26.456710000000000000
          ShowHint = False
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -16
          Font.Name = 'Times New Roman'
          Font.Style = []
          Memo.UTF8 = (
            #1056#1038#1056#1169#1056#176#1056#187'(-'#1056#176'): [Common."FIO_OTKOGO"]')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo4: TfrxMemoView
          Align = baWidth
          Top = 136.063080000000000000
          Width = 718.110700000000000000
          Height = 26.456710000000000000
          ShowHint = False
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -16
          Font.Name = 'Times New Roman'
          Font.Style = []
          Memo.UTF8 = (
            #1056#1119#1056#1109#1056#1169#1056#1111#1056#1105#1057#1027#1057#1034' _________________ /[Common."FIO_OTKOGO"]/')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo5: TfrxMemoView
          Align = baWidth
          Top = 188.976500000000000000
          Width = 718.110700000000000000
          Height = 26.456710000000000000
          ShowHint = False
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -16
          Font.Name = 'Times New Roman'
          Font.Style = []
          Memo.UTF8 = (
            #1056#1119#1057#1026#1056#1105#1056#1029#1057#1039#1056#187'(-'#1056#176'): [Common."FIO_KOMU"]')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo6: TfrxMemoView
          Align = baWidth
          Top = 238.110390000000000000
          Width = 718.110700000000000000
          Height = 26.456710000000000000
          ShowHint = False
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -16
          Font.Name = 'Times New Roman'
          Font.Style = []
          Memo.UTF8 = (
            #1056#1119#1056#1109#1056#1169#1056#1111#1056#1105#1057#1027#1057#1034' _________________ /[Common."FIO_KOMU"]/')
          ParentFont = False
          VAlign = vaCenter
        end
        object Memo7: TfrxMemoView
          Align = baWidth
          Top = 283.464750000000000000
          Width = 718.110700000000000000
          Height = 26.456710000000000000
          ShowHint = False
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clBlack
          Font.Height = -16
          Font.Name = 'Times New Roman'
          Font.Style = []
          HAlign = haRight
          Memo.UTF8 = (
            #1056#8221#1056#176#1057#8218#1056#176' '#1056#1169#1056#1109#1056#1108#1057#1107#1056#1112#1056#181#1056#1029#1057#8218#1056#176': [Date]')
          ParentFont = False
          VAlign = vaCenter
        end
      end
    end
  end
  object frxDBDataset1: TfrxDBDataset
    UserName = 'frxDBDataset1'
    CloseDataSource = False
    DataSource = dsSpisanie
    BCDToCurrency = False
    Left = 632
    Top = 336
  end
  object frxDBDataset2: TfrxDBDataset
    UserName = 'frxDBDataset2'
    CloseDataSource = False
    DataSource = dlgDS
    BCDToCurrency = False
    Left = 632
    Top = 304
  end
  object frxPDFExport1: TfrxPDFExport
    UseFileCache = True
    ShowProgress = True
    OverwritePrompt = False
    PrintOptimized = False
    Outline = False
    Background = False
    HTMLTags = True
    Author = 'FastReport'
    Subject = 'FastReport PDF export'
    ProtectionFlags = [ePrint, eModify, eCopy, eAnnot]
    HideToolbar = False
    HideMenubar = False
    HideWindowUI = False
    FitWindow = False
    CenterWindow = False
    PrintScaling = False
    Left = 504
    Top = 336
  end
  object frxXLSExport1: TfrxXLSExport
    UseFileCache = True
    ShowProgress = True
    OverwritePrompt = False
    ExportEMF = True
    AsText = False
    Background = True
    FastExport = True
    PageBreaks = True
    EmptyLines = True
    SuppressPageHeadersFooters = False
    Left = 536
    Top = 336
  end
  object frCommon: TfrxDBDataset
    UserName = 'Common'
    CloseDataSource = False
    DataSet = qCommon
    BCDToCurrency = False
    Left = 632
    Top = 376
  end
  object dsPaymants_Agr: TDataSource
    DataSet = qPaymants_Agr
    Left = 432
    Top = 448
  end
  object qPaymants_Agr: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      
        'SELECT (P_res.PLASTNAME||'#39' '#39'||P_res.PNAME||'#39' '#39'||COALESCE(P_res.P' +
        'PATRONYMIC,'#39' '#39')) AS P_RECIPIENT,'
      
        'IIF(pa.PID IS NOT NULL, (P.PLASTNAME||'#39' '#39'||P.PNAME||'#39' '#39'||COALESC' +
        'E(P.PPATRONYMIC,'#39' '#39')), COALESCE(sd.SDNAME, jl.JLOPF)||'#39' "'#39'||jl.J' +
        'LEGALNAME||'#39'" '#39') AS plat,'
      'pa.PAAMOUNT, pa.PAID'
      'FROM PAYMANTS_AGR pa'
      'LEFT OUTER JOIN PEOPLE P_res ON P_res.PID = pa.PID_POLUCH'
      'LEFT OUTER JOIN PEOPLE P ON P.PID = pa.PID'
      'LEFT OUTER JOIN JURLITSA JL ON JL.JLID = pa.JLID'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = JL.JLOPFSDID'
      'WHERE pa.RPID = :rpid'
      'AND PA.PAISDELETE IS NULL')
    Left = 467
    Top = 450
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'rpid'
        ParamType = ptUnknown
      end>
    object qPaymants_AgrP_RECIPIENT: TIBStringField
      FieldName = 'P_RECIPIENT'
      ProviderFlags = []
      Size = 767
    end
    object qPaymants_AgrPLAT: TIBStringField
      FieldName = 'PLAT'
      ProviderFlags = []
      Size = 767
    end
    object qPaymants_AgrPAAMOUNT: TIBBCDField
      FieldName = 'PAAMOUNT'
      Origin = '"PAYMANTS_AGR"."PAAMOUNT"'
      DisplayFormat = '#,###0'
      Precision = 18
      Size = 2
    end
    object qPaymants_AgrPAID: TIntegerField
      FieldName = 'PAID'
      Origin = '"PAYMANTS_AGR"."PAID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
  end
end
